﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:simpleType name="typeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="REG_SZ"/>
      <xs:enumeration value="REG_DWORD"/>
      <xs:enumeration value="REG_QWORD"/>
      <xs:enumeration value="REG_MULTI_SZ"/>
      <xs:enumeration value="REG_EXPAND_SZ"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="overwriteType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="True"/>
      <xs:enumeration value="False"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="SettingsgroupSelectionType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Single"/>
      <xs:enumeration value="Multiple"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SetRegValueType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="key" type="xs:string" use="required" />
        <xs:attribute name="value" type="xs:string" use="required" />
        <xs:attribute name="type" type="typeType" use="required" />
        <xs:attribute name="data" type="xs:string" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="DeleteRegValueType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="key" type="xs:string" use="required" />
        <xs:attribute name="value" type="xs:string" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="RenameRegValueType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="key" type="xs:string" use="required" />
        <xs:attribute name="value" type="xs:string" use="required" />
        <xs:attribute name="newValue" type="xs:string" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="CopyFileType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="source" type="xs:string" use="required" />
        <xs:attribute name="destination" type="xs:string" use="required" />
        <xs:attribute name="overwrite" type="overwriteType" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="DeleteFileType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="path" type="xs:string" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="RunCommandType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="commandline" type="xs:string" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType  name="DisplayInformationType">
    <xs:sequence>
      <xs:element name="Name" type="xs:string" default="name"/>
      <xs:element name="Description" type="xs:string"  default="description"/>
    </xs:sequence>    
  </xs:complexType>
  <xs:complexType name="SettingsType">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="SetRegValue" type="SetRegValueType" minOccurs="0" />
        <xs:element name="DeleteRegValue" type="DeleteRegValueType" minOccurs="0" />
        <xs:element name="RenameRegValue" type="RenameRegValueType" minOccurs="0" />
        <xs:element name="CopyFile" type="CopyFileType" minOccurs="0"/>
        <xs:element name="DeleteFile"  type="DeleteFileType" minOccurs="0"/>
        <xs:element name="RunCommand"  type="RunCommandType" minOccurs="0"/>
      </xs:choice>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SettingsGroupType">
    <xs:sequence>
      <xs:element name="DisplayInformation" type="DisplayInformationType"/>
      <xs:element name="Settings" type="SettingsType"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:string" use="required" />
  </xs:complexType>  
  <xs:element name="SoftwareReset">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="SettingsGroup" type="SettingsGroupType" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="selectionType" type="SettingsgroupSelectionType" use="optional" />
    </xs:complexType>
    <xs:unique name="OneSettingsGroupForEachID">
      <xs:selector xpath="SettingsGroup"/>
      <xs:field xpath="@id"/>
    </xs:unique>
  </xs:element>
</xs:schema>


